﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;
using System.Data;

public partial class UserControl_XGFQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    private void GetContent(string Title)
    {
        KCAdvanceQuery xgquery = new KCAdvanceQuery();
        string strfileID = this.fileID.Text;
        string strXGCode = Request.Form["XGCode"];
        string strDataStyle = Request.Form["DataStyle"];
        string strDataName = Request.Form["DataName"];
        //string strPMPATHName = Request.Form["PMPATHName"];
        //string strPMPATHCode = Request.Form["PMPATHCode"];




        //dl_FileList.DataSource = xgquery.XGAdvancedQuery(strfileID, strXGCode, strDataStyle, strDataName);
        //dl_FileList.DataBind();


        DataSet ds = xgquery.XGAdvancedQuery(strfileID, strXGCode, strDataStyle, strDataName);
        DataTable dt = ds.Tables[0];
        DataView dv = dt.DefaultView;
        //对用于分页的类的引用
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = dt.DefaultView;//设置数据源(DataTable类型)
        pds.AllowPaging = true;


        AspNetPager1.RecordCount = dv.Count;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        dl_FileList.DataSource = pds;
        dl_FileList.DataBind();

    }



    protected void SearchBtn_Click(object sender, ImageClickEventArgs e)
    {
        //KCAdvanceQuery xgquery = new KCAdvanceQuery();
        //dl_FileList.DataSource = xgquery.XGAdvancedQuery(null, null, null, null);
        //dl_FileList.DataBind();\
        GetContent("");
        FileList.Attributes["style"] = "display:''";
    }

    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetContent("");
    }

}


